package com.magicsharpmod.block;

import com.magicsharpmod.MagicSharpMod;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;

public class ModBlocks {

    public static final Block GUN_BLOCK = registerBlocks("gun_block",
            new Block(FabricBlockSettings.copyOf(Blocks.STONE)));

    public static final Block MSFIRE_BLOCK = registerBlocks("msfire_block",
            new Block(FabricBlockSettings.copyOf(Blocks.STONE)));

    public static final Block MAGIC_BLOCK = registerBlocks("magic_block",
            new Block(FabricBlockSettings.copyOf(Blocks.STONE)));

    private static Block registerBlocks(String name, Block block) {
        registerBlockItems(name, block);
        return Registry.register(Registries.BLOCK,new Identifier(MagicSharpMod.MOD_ID, name), block);
    }

    private static Item registerBlockItems(String name, Block block) {
        return Registry.register(Registries.ITEM,new Identifier(MagicSharpMod.MOD_ID, name),
                new BlockItem(block,new FabricItemSettings()));
    }

    public static void registerModBlocks() {

    }//这应该是重写的方法
}
